komotis = function(id, login, onoma, energos, sira){
	this.id = id;
	this.login = login;
	this.onoma = onoma;
	this.energos = energos;
	this.sira = sira;
	this.currentRow = 1;
	this.dom = {};
	
	this.init = function() {
		this.dom.name_button = document.createElement("input");
		this.dom.name_button.setAttribute("type", "button");
		this.dom.name_button.setAttribute("value", this.onoma);
		this.dom.name_button.setAttribute("onClick", "globals.setCurKom(this)");
		this.dom.name_button.father = this;
		
		this.dom.perigrafiInput = [];
		this.dom.hiddenInput = [];
		this.dom.posoInput = [];
		var rows = 21;
		for (var x = 1; x <= rows; x++) {
			this.dom.perigrafiInput[x] = document.createElement("input");
			this.dom.perigrafiInput[x].setAttribute("type", "text");
			this.dom.perigrafiInput[x].setAttribute("id", "perigrafi_" + this.id + "_" + x);
			this.dom.perigrafiInput[x].setAttribute("class", "perigrafi_input");
			this.dom.perigrafiInput[x].setAttribute("name", "perigrafi_" + this.id + "_" + x);
			this.dom.perigrafiInput[x].setAttribute("onDblClick", "globals.del(this)");
			this.dom.perigrafiInput[x].onkeypress = function(e){
					return false;
				}

			this.dom.perigrafiInput[x].setAttribute("onClick", "globals.setCurInput(this)");
			this.dom.perigrafiInput[x].father = this;
			this.dom.perigrafiInput[x].aa = x;
			
			this.dom.hiddenInput[x] = document.createElement("input");
			this.dom.hiddenInput[x].setAttribute("type", "hidden");
			this.dom.hiddenInput[x].setAttribute("id", "data_" + this.id + "_" + x);// + "_");
			this.dom.hiddenInput[x].setAttribute("class", "hidden_input");
			this.dom.hiddenInput[x].setAttribute("name", "data_" + this.id + "_" + x);// + "_");
			this.dom.hiddenInput[x].setAttribute("value" , "");
			this.dom.hiddenInput[x].father = this;
			this.dom.hiddenInput[x].aa = x;
			
			this.dom.posoInput[x] = document.createElement("input");
			this.dom.posoInput[x].setAttribute("type", "text");
			this.dom.posoInput[x].setAttribute("id", "poso_" + this.id + "_" + x);
			this.dom.posoInput[x].setAttribute("class", "poso_input");
			this.dom.posoInput[x].setAttribute("name", "poso_" + this.id + "_" + x);
			this.dom.posoInput[x].setAttribute("onChange", "globals.setPoso(this, " + this.id + ", " + x + ")");
			this.dom.posoInput[x].onkeypress = function(e){
				e = e || event;
				var chr = e.keyCode;
				//alert(chr);
				if (!(chr >= 48 && chr <= 57) && !(chr == 46)) {
					return false;
				}
			}
			this.dom.posoInput[x].father = this;
			this.dom.posoInput[x].aa = x;
			
		}
		// this.dom.hidden = document.createElement("input");
		// this.dom.hidden.setAttribute("type", "hidden");
		// this.dom.hidden.setAttribute("name", "hidden_" + this.sira);
		// this.dom.hidden.setAttribute("value", this.id);
		// this.dom.hidden.father = this;
		
	}
}
